package com.seaside.park.mapper.cabinet;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.seaside.park.bean.cabinet.CabinetCell;
import com.seaside.park.bean.cabinet.GoodInfo;
import com.seaside.park.bean.cabinet.vo.GoodVO;
import com.seaside.park.bean.cabinet.vo.LocationVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodInfoMapper extends BaseMapper<GoodInfo> {
    @Select("select gi.good_degree,gi.good_id,di.user_openid,gi.good_price,cc.cell_no,good_name from cabinet_cell as cc, good_info as gi,deposit_info as di where cc.good_id = gi.good_id and cc.despoit_id=di.deposit_id and gi.if_publish=1 and di.deposit_cabitnet=#{cabinetId}")
    List<GoodVO> getGoodByCabinetId(int cabinetId);
    @Select("SELECT cabinet_name,cell_no FROM cabinet_cell cc , cabinet c WHERE cc.cabinet_id=c.id AND cc.good_id=#{goodId}")
    LocationVO getLocationByGoodId(int goodId);
}
